package com.living.filedownloader.ui.adapter;

import android.view.ViewGroup;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.liulishuo.filedownloader.BaseDownloadTask;
import com.liulishuo.filedownloader.FileDownloadListener;
import com.liulishuo.filedownloader.FileDownloadSampleListener;
import com.living.R;
import com.living.filedownloader.bean.TasksManagerModel;

import org.jetbrains.annotations.NotNull;

import java.util.Map;

/***
 * 下载适配器
 */
public class TaskItemDownloadedAdapter extends BaseQuickAdapter<TasksManagerModel, BaseViewHolder> {


    public TaskItemDownloadedAdapter() {
        super(R.layout.item_downloaded_task);
        addChildClickViewIds(R.id.task_action_more);
    }

    @NotNull
    @Override
    protected BaseViewHolder onCreateDefViewHolder(@NotNull ViewGroup parent, int viewType) {
        BaseViewHolder holder = super.onCreateDefViewHolder(parent, viewType);
        return holder;
    }

    @Override
    protected void convert(@NotNull BaseViewHolder holder, TasksManagerModel model) {
        holder.setGone(R.id.task_action_more, false);
        holder.setGone(R.id.task_action_select, true);
        holder.setText(R.id.task_name_tv, model.getAudioId() + "  " + model.getName());
        holder.setText(R.id.task_status_tv, model.getAuthor() + "");
    }


}
